package PTA_3;
class Complex {
	double a,b;
	public Complex(double a, double b) {
		super();
		this.a = a;
		this.b = b;
	}
	public String getString() {
		return "("+a+","+b+"i)";
	}
	public Complex add(Complex c) {
		Complex flag = new Complex(a,b);
		flag.a+=c.a;
		flag.b+=c.b;
		return flag;
	}
	public Complex sub(Complex c) {
		Complex flag = new Complex(a,b);
		flag.a -= c.a;
		flag.b -= c.b;
		return flag;
	}
}

public class t1 {
	public static void main(String args[]){
        Complex c1=new Complex(3,4);
        Complex c2=new Complex(1,2);
        System.out.println("c1="+c1.getString()+",c2="+c2.getString());
        System.out.println("c1+c2="+c1.add(c2).getString());
        System.out.println("c1-c2="+c1.sub(c2).getString());        
    }
}
